EMG (experimental)

Teslasuit v. Teslasuit SDK Python

Quick access

Intro

The EMG subsystem provides functionality to access and process Electromyography (EMG) data from Teslasuit devices.

Note:

Since TsEmg is a member of the device class, it cannot be used independently without an active Teslasuit device.

Class TsEmg

Provides an interface for interacting with the Teslasuit EMG subsystem.
This class allows for streaming EMG data, setting filter options, and retrieving raw EMG data.

Class methods:


set_options(self, lower_bandwidth, upper_bandwidth, sample_frequency, sample_size)

Set options for EMG streaming, such as filter parameters.

Args:

  • lower_bandwidth (int): Filter’s lower bandwidth.
  • upper_bandwidth (int): Filter’s upper bandwidth.
  • sample_frequency (int): Sampling frequency.
  • sample_size (int): Sample size.

start_streaming(self)

Start EMG streaming for a provided device handle.
This method subscribes to the data update callbacks and starts the streaming process.


stop_streaming(self)

Stop EMG streaming for a provided device handle.
This method unsubscribes from the data update callbacks and stops the streaming process.


get_data_on_ready(self)

Wait until EMG data is ready and retrieve it.
This method blocks until data is available or streaming is stopped.

Returns:

  • TsEmgData: The latest EMG data object containing information about nodes, channels, and timestamps.

Access to the data

These code snippets and charts are just an example of how is the data flow looks like. to know more, please visit data structures page.

Access to EMG channel data

TsEmg.get_data_on_ready().nodes[0].channels[0].samples[0]

flowchart TD
A[TsEmgData] --> B[TsEmgNodeData]
B --> C[TsEmgChannelData]
C --> D[samples]

Access to EMG options

TsEmg.get_data_on_ready().options.lower_bandwidth

flowchart TD
A[TsEmgOptions] --> B[lower_bandwidth]
A --> C[upper_bandwidth]
A --> D[sampling_frequency]
A --> E[sample_size]